<?php
namespace plugins\sms_account\validate;

use think\Validate;

class SmsAccountValidate extends Validate
{
    protected $rule = [
        // 用|分开
        'uid|用户id'            =>  'require|unique:sms_account',
        'account|用户账号'       =>  'require|min:6|max:32|unique:sms_account',
        'password|用户密码'      =>  'require|min:6|max:32',
        'signature|短信签名'     =>  'require',
        'total_num|短信条数'     =>  'require',

        'pay_way|支付方式'      =>  'require',
        'money|充值金额'        =>  'require',
        'num|购买数量'          =>  'require|number',
    ];

    // 定义验证场景
    protected $scene = [
        // 添加
        'add'               =>  ['uid', 'account', 'password', 'signature', 'total_num'],
        // 追加条数
        'addNum'            =>  ['pay_way', 'money', 'num']
    ];


}